project(bcast_stat)

cmake_minimum_required(VERSION 2.8)
add_definitions("-std=c++11")
add_definitions("-ftemplate-backtrace-limit=0")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall  -pedantic")
find_package( Boost REQUIRED COMPONENTS  system thread program_options regex)
find_package(Threads REQUIRED)
find_package(Glog REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Protobuf REQUIRED )
find_package(CryptoPP REQUIRED)

set(PROTO_FILES ${CMAKE_SOURCE_DIR}/messages/stats.proto)


INCLUDE_DIRECTORIES(
    common/config
    common/daemon
    common/
    ${CMAKE_SOURCE_DIR})



#include_directories(${PROJECT_BINARY_DIR}/stats_client)
#include_directories(${PROJECT_BINARY_DIR}/stats_server)

set(CONFIG_LIB_NAME AppConfig)
set(DAEMON_LIB_NAME Daemon)
set(LOGGING_LIB_NAME Log)
add_subdirectory(common/config)

add_subdirectory(stats_server)
add_subdirectory(stats_client)

set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
include(InstallRequiredSystemLibraries)
set(CPACK_GENERATOR "DEB")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "1")
set(CPACK_PACKAGE_VERSION_PATCH "0")

set(CPACK_PACKAGE_DESCRIPTION "General purpose stats server/client")
set(CPACK_PACKAGE_CONTACT "Razvan Coca razvan.coca@gmail.com")
include(CPack)
